package com.time.client.common.enums;

import lombok.Getter;

/**
 * 评论状态枚举类
 *
 * @author: HuangQi
 * @date: Created in 10:47 2025/10/9
 * @description: 评论状态枚举
 */
@Getter
public enum CommentStatusEnum {

    PENDING(0, "待审核"),
    APPROVED(1, "已通过"),
    REJECTED(2, "未通过"),
    DELETED(3, "已删除");


    private int code;
    private String desc;

    CommentStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static CommentStatusEnum fromCode(int codeVal) {
        for (CommentStatusEnum commentStatusEnum : values()) {
            if (commentStatusEnum.code == codeVal) {
                return commentStatusEnum;
            }
        }
        return null;
    }
}
